'use strict';
const db = uniCloud.database();
const slqrcode = db.collection('slqrcode');
exports.main = async (event, context) => {
	console.log(event, '——————拿到的参数')
	let response = await slqrcode.get()
	console.log(response, '___s')
	response.data[0].list[event.tabIdx].list.push(event.qrcode);
	if (event.qrcode.name) {
		let res = await slqrcode.doc('08382b337b61475ba62d2f6b24be0cb9').update({list:response.data[0].list});
		console.log(res)
	} else {
		return {
			code: 60000,
			msg: '参数错误'
		}
	}
	return {
		code: 10000,
		msg: '成功'
	}
};
